package com.yayohos.locationmanager.listener;


import com.yayohos.locationmanager.constants.FailType;

import ohos.location.Location;

/**
 * 定位回调接口
 */
public interface LocationListener {
    /**
     * onProcessTypeChanged
     *
     * @param processType new on going process
     *                    This method will be called whenever the process is changed.
     */
    void onProcessTypeChanged(int processType);

    /**
     * onLocationChanged
     *
     * @param location This method will be invoked whenever new location update received
     */
    void onLocationChanged(Location location);

    /**
     * onLocationFailed
     *
     * @param type When it is not possible to receive location, such as no active provider or no permission etc.
     *             It will pass an integer value from {@linkplain FailType}
     *             which will help you to determine how did it fail to receive location
     */
    void onLocationFailed(int type);

    /**
     * onPermissionGranted
     *
     * @param alreadyHadPermission This method will be invoked when user grants for location permissions,
     *                             or when you ask for it but the application already had that granted.
     *                             You can determine if permission is just granted or
     *                             did the application already have it by checking boolean input of this method.
     */
    void onPermissionGranted(boolean alreadyHadPermission);

    /**
     * onStatusChanged
     *
     * @param status This method will be invoked if only you use location
     *               with GPS or Network Providers to receive location
     */
    void onStatusChanged(int status);

    /**
     * onProviderEnabled
     *
     * @param provider This method will be invoked if only you use location
     *                 with GPS or Network Providers to receive location
     */
    void onProviderEnabled(String provider);

    /**
     * onProviderDisabled
     *
     * @param provider This method will be invoked if only you use location
     *                 with GPS or Network Providers to receive location
     */
    void onProviderDisabled(String provider);

}